<?
/*! \brief Holds an OpenBT service XML
 * 
 */
class XML
{
	protected $_xml;
	
	function __construct() {}
	
	public function setSimpleXml($xml='') 
	{
		$this->_xml = $xml;
	}
	
	public function setStringXml($xml='')
	{
		if(! $xmlString = simplexml_load_string($xml))
			return false;
		
		$this->setSimpleXml($xmlString);
		return true;
	}
	
	public function setFileXml($fname='')
	{
		if(! $xmlFile = simplexml_load_file($fname))
				return false;
		$this->setSimpleXml($xmlFile);
		return true;
	}
	
	public function getXml() 
	{
		return $this->_xml->asXML();
	}
	
	public function getSimple() 
	{
		return $this->_xml;
	}
	
	public function isXml($content)
	{
		$a = simplexml_load_string($content);
		return $a;
	}
}